import request from '@/utils/request.js'
/* 获取组织架构数据 */
export function getDepartments() {
  return request({
    url: '/company/department'
  })
}
/* 删除部门 */
export function deleteDepartmentsById(id) {
  return request({
    method: 'delete',
    url: `/company/department/${id}`
  })
}
/* 新增部门 */
export function addDepartments(data) {
  return request({
    method: 'post',
    url: ' /company/department',
    data
  })
}
/* 根据id查询部门详情 */
export function getDeptsDetailsById(id) {
  return request({
    url: `/company/department/${id}`
  })
}
/* 根据ID修改部门详情 */
export function editDeptsById(data) {
  return request({
    method: 'put',
    url: `/company/department/${data.id}`,
    data
  })
}
